#include<stdio.h>
int DigitSum(int a)
{
	int b = 0;
	if(a/10 != 0)
	{
		b = a % 10;
		return b + DigitSum(a / 10);
	}
	else return a;

}
int main()
{
	int n = 0;
	scanf("%d",&n);
	int sum = DigitSum(n);
	printf("%d",sum);
}
